package com.xinqi.modules.chat.chat.message.controller.app;

import com.xinqi.common.base.response.R;
import com.xinqi.common.satoken.utils.LoginHelper;
import com.xinqi.modules.chat.chat.message.dto.req.ChatRemindMessageCreateDTO;
import com.xinqi.modules.chat.chat.message.service.ChatRemindMessageService;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * APP -- 聊天消息提醒
 *
 * @author: yyzhen
 * @date: 2023/07/05
 */
@Validated
@RestController
@RequestMapping("/app/chat-remind-message")
@RequiredArgsConstructor
public class ChatRemindMessageAppController {

    private final ChatRemindMessageService chatRemindMessageService;

    @Operation(summary = "添加提醒")
    @PostMapping("/remind")
    public R<Long> addRemindMessage(@Validated @RequestBody ChatRemindMessageCreateDTO dto) {
        return R.data(chatRemindMessageService.addRemindMessage(dto, LoginHelper.getXqLoginUser()));
    }

}
